function youhui(){
    (function(){
        let uu =document.querySelector("#nav ul")
        
        fetch("http://chst.vip:1234/api/getcoupon")
        .then(body => body.json())
        .then(res => {
                let html = ""
                console.log(res);
                res.result.forEach(item => {
                    html += `
                        <a href="./couponproduct.html?couponid=${item.couponId}">
                        <li couponid=${item.couponId}>
                            <img src="${item.couponImg}" alt="">
                            <p>${item.couponTitle}</p>
                        </li>
                        </a>
                        `
                })
                // console.log(uu);
                uu.innerHTML = html

                let lis=[...uu.children]

                lis.forEach(li=>{
                    li.onclick=function(){
                        let couponid=this.getAttribute("couponid")
                    }
                })

                
        }) 



    })()
}